<?php

class ResultSet {
	private $_rows;
	private $_pointer = 0;
	private $_length = 0;
	public function __construct($rows){
		$this->_rows = $rows;
		$this->_length = sizeof($rows);
	}
	public function getPosition(){
		return $this->_pointer;
	}
	public function getLength(){
		return $this->_length;
	}
	public function reset(){
		$this->_pointer = 0;
	}
	public function next(){
		if($this->_pointer>=$this->_length){
			return null;
		}
		return $this->_rows[$this->_pointer++];
	}
}

?>